package com.lipaluma.field.validator.strategies;


/**
 * Strategy used for substrings validators
 * 
 * @see SubStringsForbiddenOnEachValueValidator
 * @see SubString
 * @author Mario
 */
public enum SubStringMatcherValidationStrategy {
	STARTS_WITH {
		@Override
		public boolean matches(String value, String substring) {
			return value.startsWith(substring);
		}
	}, ENDS_WITH {
		@Override
		public boolean matches(String value, String substring) {
			return value.endsWith(substring);
		}
	}, CONTAINS {
		@Override
		public boolean matches(String value, String substring) {
			return value.contains(substring);
		}
	};
	
	public abstract boolean matches(String value, String substring);
}
